# Makefile for Dackel

include ../src/Makefile.inc

INCLUDE += -I../src
TARGETS = logic_test

all: $(TARGETS)

logic_test: logic_test.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o logic_test $(OBJS) logic_test.cpp $(LIBS) $(shell root-config --libs --cflags)

dfm_test: dfm_test.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o dfm_test $(OBJS) dfm_test.cpp $(LIBS)

spektrum: spektrum.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o spektrum $(OBJS) spektrum.cpp $(LIBS) 
        
testseq: testseq.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o testseq $(OBJS) testseq.cpp $(LIBS) 

test_TimeCounter: test_TimeCounter.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_TimeCounter $(OBJS) test_TimeCounter.cpp $(LIBS) 

adc_test: adc_test2.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o adc_test $(OBJS) adc_test2.cpp $(LIBS) $(shell root-config --libs --cflags)

qdc_test: qdc_test3.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o qdc_test $(OBJS) qdc_test3.cpp $(LIBS) $(shell root-config --libs --cflags)
                
test_TDC: test_TDC.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_TDC $(OBJS) test_TDC.cpp $(LIBS) 

test_QDC_V792: test_QDC_V792.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_QDC_V792 $(OBJS) test_QDC_V792.cpp $(LIBS) 

test_QDC_V965A: test_QDC_V965A.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_QDC_V965A $(OBJS) test_QDC_V965A.cpp $(LIBS)
        
test_ConfigReader: test_ConfigReader.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_ConfigReader $(OBJS) test_ConfigReader.cpp $(LIBS) 

test_BufferVMEReader: test_BufferedVMEReader.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o test_BufferedVMEReader $(OBJS) test_BufferedVMEReader.cpp $(LIBS) 

test_teebuf: test_teebuf.cpp teebuf.h
	$(CXX) $(CXXFLAGS) -o test_teebuf test_teebuf.cpp

gztest: gztest.c
	$(CC) $(CCFLAGS) $(LIBDIR) $(INCLUDE) gztest.c -lz -o gztest

exp_test: exp_test.c
	$(CC) $(CCFLAGS) $(LIBDIR) $(INCLUDE) exp_test.c -o exp_test

test_DigitalIO: test_DigitalIO.cpp DigitalIO_DL636F.h DigitalIO_DL636F.cpp
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) test_DigitalIO.cpp -o test_DigitalIO $(OBJS) $(LIBS)

test_StartStop: test_StartStop.cpp StartStop.h StartStop.cpp
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) test_StartStop.cpp -o test_StartStop $(OBJS) $(LIBS)

test_rate: test_rate.cpp $(OBJS) $(HDRS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) test_rate.cpp -o test_rate $(OBJS) $(LIBS)

rate_test: rate_test.cpp $(OBJS)
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) rate_test.cpp -o rate_test $(OBJS) $(LIBS)

test_tm: test_tm.cpp
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o $@ $^

prof_test: prof_test.cpp ../src/Profile.o ../src/inifile.o
	$(CXX) $(CXXFLAGS) $(LIBDIR) $(INCLUDE) -o $@ $^
        
clean:
	-rm *.o $(TARGETS)

install:


